package cn.youth.datacollection.controller;

import cn.youth.datacollection.core.povo.Result;
import cn.youth.datacollection.entity.KFailRetryLog;
import cn.youth.datacollection.entity.KRepository;
import cn.youth.datacollection.service.KFailRetryLogService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @auther chen1
 * @create 2022-04-05 18:27
 */
@RestController
@RequestMapping("dataCollection/kFailRetryLog")
@Api(tags = "失败重试控制器")
public class KFailRetryLogController {

    @Autowired
    KFailRetryLogService kFailRetryLogService;

    @GetMapping("getLogByRecord")
    @ApiOperation("获取日志")
    public Result getLogByRecord(@RequestParam("recordId") String recordId) {
        LambdaQueryWrapper<KFailRetryLog> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(KFailRetryLog::getFailRetryRecordId,recordId);
        KFailRetryLog log = kFailRetryLogService.getOne(queryWrapper);
        return Result.ok(log);
    }
}
